{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/kth-largest-element-in-a-stream\n",
    "\n",
    "\n",
    "\n",
    "Runtime: 1012 ms, faster than 14.32% of Python3 online submissions for Kth Largest Element in a Stream.\n",
    "Memory Usage: 18.5 MB, less than 13.66% of Python3 online submissions for Kth Largest Element in a Stream.\n",
    "\n",
    "\n",
    "\n",
    "```python\n",
    "class KthLargest:\n",
    "\n",
    "    def __init__(self, k: int, nums: List[int]):\n",
    "        self.k = k-1\n",
    "        self.nums = nums\n",
    "        \n",
    "\n",
    "    def add(self, val: int) -> int:\n",
    "        self.nums.append(val)\n",
    "        self.nums.sort(reverse=True)\n",
    "        return self.nums[self.k]\n",
    "```\n",
    "\n",
    "\n",
    "\n",
    "Spent 20 minutes just to aware that I need to add `reverse=True`. (Yes, the mission is to find the largest num)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
